<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>动态绑定 class属性对象语法</title>
</head>
<script src="../../../../../js/vue.global.js"></script>
<style>
    .colordecroation {
        color: red;
    }
    .linedecoration {
        text-decoration: underline;
    }
</style>

<body>
<div id="app">
    <h1 class="colordecroation">Hello World!</h1>
    <!--    对象与噶格式{类名：true}-->
    <h1 v-bind:class={linedecoration:true,colordecroation:true}>Hello World!</h1>
    <h1 v-bind:class="{colordecroation:iscolordecroatio,linedecoration:islinedecoration}">Hello World!</h1>
    <h1 v-bind:class="iscolordecroatio">Hello World!</h1>
    <h1 v-bind:class="islinedecoration">Hello World!</h1>
    <h1 v-bind:class="[iscolordecroatio,islinedecoration]">Hello World!</h1>
    <h1 v-bind:class="all">Hello World!</h1>
    <h1 v-bind:class="joinAll">Hello World!</h1>

</div>
</body>
<script>
    const app = Vue.createApp({
        data(){
            return {
                iscolordecroatio:"colordecroatio",
                islinedecoration:"linedecoration",
                all: "colordecroatio linedecoration",
                // joimAll:this.iscolordecroatio+""+this.islinedecoration
                // classStyle1:{
                //     colordecroation:true,
                //     // linedecoration: false
                // },
                // classStyle2:{
                //     // colordecroation:false,
                //     linedecoration: true
                // }
            }

        },

        computed:{
            joinAll(){
               return this.iscolordecroatio+" "+this.islinedecoration
            }
            }
        // methods:{
        //     getClass(){
        //         return {colordecroation:this.iscolordecroatio,linedecoration: this.islinedecoration}
        //     }
        // }
    })
    app.mount("#app")
</script>
</html>